package com.wyz.rabbitmqconsumer.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class DeadRabbitmqConfig {

    @Bean
    public DirectExchange getDeadDirectExchange(){

        return new DirectExchange("dead_direct_exchange", true, false);
    }

    @Bean
    public Queue getDeadDirectSmsQueue(){
        return new Queue("dead.direct.queue", true);
    }

    @Bean
    public Binding getDeadBinding(){
        return BindingBuilder.bind(getDeadDirectSmsQueue()).to(getDeadDirectExchange()).with("dead");
    }

}
